package cn.wolfcode.trip.base.domain;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 *  攻略目录
 */
@Setter
@Getter
@JsonIgnoreProperties("handler")
public class StrategyCatalog extends BaseDomain{
    //名称
    private String name;
    //所属攻略
    private Strategy strategy;
    //序号
    private Integer sequence;
    //状态
    private Boolean state = false;
    //攻略文章
    private List<StrategyDetail> details;

    public String getStateName(){
        return state?"启动":"引用";
    }

    public String getJson() {
        //共享给按钮的json数据
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("name", name);
        map.put("sequence", sequence);
        map.put("state", state);
        map.put("strategy", strategy);
        return JSON.toJSONString(map);
    }
   

   
}



